unit FormOption_U;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls,KsColorBall,AcroMultiDD, ComCtrls;

type
  TFormOption = class(TForm)
    GroupBox1: TGroupBox;
    ComboBox_NewBallCount: TComboBox;
    ComboBox_Icon: TComboBox;
    Label1: TLabel;
    Label2: TLabel;
    ComboBox_LineWidth: TComboBox;
    ComboBox_IconKind: TComboBox;
    Label3: TLabel;
    Label4: TLabel;
    CheckBox_Animate: TCheckBox;
    Button1: TButton;
    Button2: TButton;
    CheckBox_PlaySound: TCheckBox;
    TrackBar_Alpha: TTrackBar;
    Label5: TLabel;
    CheckBox_ObjectFly: TCheckBox;
    procedure FormShow(Sender: TObject);
    procedure ComboBox_NewBallCountChange(Sender: TObject);
    procedure ComboBox_IconChange(Sender: TObject);
    procedure ComboBox_LineWidthChange(Sender: TObject);
    procedure ComboBox_IconKindChange(Sender: TObject);
    procedure CheckBox_AnimateClick(Sender: TObject);
    procedure CheckBox_PlaySoundClick(Sender: TObject);
    procedure TrackBar_AlphaChange(Sender: TObject);
    procedure CheckBox_ObjectFlyClick(Sender: TObject);
  private
    { Private declarations }
    FOption:TOptions;
  public
    { Public declarations }
    constructor Create(AOwner:TComponent;AOption:TOptions);virtual;
  end;

var
  FormOption: TFormOption;

implementation

{$R *.dfm}

constructor TFormOption.Create(AOwner: TComponent; AOption: TOptions);
begin
  inherited Create(AOwner);
  FOption:=AOption;
end;

procedure TFormOption.FormShow(Sender: TObject);
begin
  //AcroDDStorage.ReplaceComLanguage('DD_ColorBall',ComboBox_Icon,InttoStr(GetACP),'0',nil,true,false,false,false,nil,true);
  ComboBox_Icon.ItemIndex:=StrToInt(FOption.IconSystem);
  ComboBox_LineWidth.ItemIndex:=FOption.LineWidth-2;
  ComboBox_IconKind.ItemIndex:=FOption.IconKind-2;
  CheckBox_Animate.Checked:=FOption.Animate;
  ComboBox_NewBallCount.ItemIndex:=FOption.NewBallCount-1;
  CheckBox_PlaySound.Checked:=FOption.PlaySound;
  CheckBox_ObjectFly.Checked:=FOption.ObjectFly;
  TrackBar_Alpha.Position:=FOption.BackAlpha;
end;

procedure TFormOption.ComboBox_NewBallCountChange(Sender: TObject);
begin
  FOption.NewBallCount:=1+ComboBox_NewBallCount.ItemIndex;
end;

procedure TFormOption.ComboBox_IconChange(Sender: TObject);
begin
  FOption.IconSystem:=InttoStr(ComboBox_Icon.ItemIndex);
end;

procedure TFormOption.ComboBox_LineWidthChange(Sender: TObject);
begin
  FOption.LineWidth:=2+ComboBox_LineWidth.ItemIndex;
end;

procedure TFormOption.ComboBox_IconKindChange(Sender: TObject);
begin
  FOption.IconKind:=ComboBox_IconKind.ItemIndex+2;
end;

procedure TFormOption.CheckBox_AnimateClick(Sender: TObject);
begin
  FOption.Animate:=CheckBox_Animate.Checked;
end;

procedure TFormOption.CheckBox_PlaySoundClick(Sender: TObject);
begin
  FOption.PlaySound:=CheckBox_PlaySound.Checked;
end;

procedure TFormOption.TrackBar_AlphaChange(Sender: TObject);
begin
  FOption.BackAlpha:=TrackBar_Alpha.Position;
end;

procedure TFormOption.CheckBox_ObjectFlyClick(Sender: TObject);
begin
  FOption.ObjectFly:=CheckBox_ObjectFly.Checked;
end;

end.
